package com.pw.study.ctp;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

public class WordClient {
    public static void main(String[] args) {
        try {
            Socket socket = new Socket("localhost", 9999);
            DataInputStream input = new DataInputStream(socket.getInputStream());
            int count=0;
            while (true){
                String line = input.readUTF();
                count++;
                System.out.println(count+" line:"+line);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
